"""
@Author: 霍格沃兹测试开发学社-西西
@Desc: 更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860
"""


class Animal:
    def __init__(self, name, age, gender, style):
        self.name = name
        self.age = age
        self.gender = gender
        self.style = style

    def __str__(self):
        return f"{self.name}, 年龄：{self.age}"

    def run(self):
        pass

    def dump(self):
        pass

    def eat(self):
        print("正在吃")

    def sleep(self):
        print("正在睡")


class Cat(Animal):
    # 使用自己的方法 ,如果与父类的方法同名就覆盖这个方法
    def __init__(self, name, age, gender, style, special):
        self.name = name
        self.age = age
        self.gender = gender
        self.style = style
        self.special = special

    def run(self):
        print("特殊的跑法")

    def climb_tree(self):
        '''上树'''
        print("上树")

    def catch_mice(self):
        '''抓老鼠'''
        print("抓老鼠")


class Dog(Animal):
    pass
    # def __init__(self, name, age, gender, style,special):
    #     self.name = name
    #     self.age = age
    #     self.gender = gender
    #     self.style = style
    #     self.special = special
    #
    # def run(self):
    #     pass
    #
    # def dump(self):
    #     pass
    #
    # def eat(self):
    #     print("正在吃")
    #
    # def sleep(self):
    #     print("正在睡")
    #
    # def go_for_a_walk(self):
    #     print("出去遛达")

if __name__ == '__main__':
    cat = Cat("小小", 11, "公", "aaa","")
    cat.dump()
    cat.sleep()
    cat.run()
    cat.catch_mice()

    print(isinstance(cat, Cat))

    print(issubclass(Animal, Cat))
